//#include "cx_platform_base.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "vmsys.h"
#include "vmio.h"
#include "vmchset.h"
#include "vmgraph.h"
#include "vmlog.h"
#include "vmstdlib.h"
#include "cx_log.h"

QVOID* pQQEditCtrl;

extern QVOID EndEditHandler(QVOID* pEditCtrl, QINT state, short* text);

QVOID cx_inputctrl_sethandler(QVOID* pEditCtrl)
{
	pQQEditCtrl = pEditCtrl;
}

QVOID cx_inputctrl_endedit(QINT state, short* text)
{
		char log[50];
		 sprintf(log, "cx_inputctrl_endedit[state]=%d", state);
    //write_log_by_string(log);
	EndEditHandler(pQQEditCtrl, state, text);

	//write_log_by_string("end of cx_inputctrl_endedit");
}

QINT cx_inputctrl_starteditwindow(QVOID (*f)(VMINT state, VMWSTR text))
{
	return vm_input_text(f);
}

QINT cx_inputctrl_starteditwindow2(VMWSTR def_str, VMINT def_input_method)
{
	char log[50];
    QINT tRet = 0;
	tRet = vm_input_text2(def_str, def_input_method, cx_inputctrl_endedit);
    sprintf(log, "cx_inputctrl_starteditwindow2[tRet]=%d",tRet);
    //write_log_by_string(log);
    return tRet;
}

